'# Copyright (c) 2008-2011 Hacker Wez
'# Source code distributed under the GNU Lesser license
'# http://bluepillredpill.codeplex.com/license
Public Class glyph : Inherits glyphbase

    Dim last_footprint_offset As Integer = 0


    ''' <summary>
    ''' speed of movement
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Speed() As Integer
        Get
            Return _Speed
        End Get
        Set(ByVal value As Integer)
            _Speed = value
        End Set
    End Property
    Private _Speed As Integer

    ''' <summary>
    ''' clone a footprint glyph
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Overrides Function spawn_footprint() As Object
        If (Me.Y - last_footprint_offset >= GLYPH_SPRITE_SIZE) Then
            last_footprint_offset = Me.Y
            Dim clone As New footprint
            With clone
                .X = Me.X
                .Y = Me.Y
                .Index = Me.Index
                .Decay = Me.Decay
                .Life = 100
                .Volatility = Me.Volatility \ 2     ' footprints have less volatility than their parents
            End With
            Return clone
        Else
            Return Nothing
        End If
    End Function


End Class
